apiVersion: v1
kind: Service
metadata:
    name: portal-svc
    namespace: spark-cluster
spec:
    type: NodePort
    ports:
        - port: 80
          targetPort: 80
          nodePort: 30084
          name: portal-web
        - port: 22
          targetPort: 22
          name: portal-ssh
    selector:
        name: portal

---
apiVersion: v1
kind: ReplicationController
metadata:
    name: portal-rc
    namespace: spark-cluster
spec:
    replicas: 1
    template:
        metadata:
            labels:
                name: portal
        spec:
            containers:
            - image: index.tenxcloud.com/zhangshun/portal:longsys
              name: portal
              env:
                - name: DB_HOST
                  value: portal-db-svc
                - name: DB_PORT
                  value: 5432
                - name: DB_NAME
                  value: cds
                - name: DB_USER
                  value: cdsadmin
                - name: DB_PWD
                  value: pgpassw0rd
                - name: DB_TYPE
                  value: postgres
				- name: REDIS_URL
                  value: redis://redis-master:6379
              ports:
              - containerPort: 80
                name: portal-web
              - containerPort: 22
                name: portal-ssh
